<template>
  <el-dialog class="tl-dialog" v-dialogDrag="true" :title="title" :visible.sync="visible" width="430px" height="300px" @open="open" @close="close" :append-to-body="true">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
      <el-form-item label="岗位名称" prop="newMarketingpost" :rules="rules.validateRequire">
        <el-input v-model.trim="model.newMarketingpost" @keyup.native="trimLR" :rows="1"></el-input>
      </el-form-item>
      <input type="text" style="display:none" />
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>
<script>
/** mixins */
import { mixin_edit } from "@tapui/mixins/mixin_edit"
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from "@tapui/utils/http"
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: {},
  data() {
    return {
      moduleTitle: "行销岗位",
      urlPrefix: "mms/provinceMarketingInfo/addMarketingpost/",
      url: {
        // querycode置空 防止报错
        queryCodeList: ""
      },
      isAdd: true,
      visible: false
    }
  },
  methods: {
    open() {
      if (this.isAdd === true) {
        this.title = "添加" + this.moduleTitle
      }
    },
    trimLR() {
      this.formData.title = this.formData.title.replace(/^\s+|\s+$/gm, "")
    }
  }
}
</script>
<style lang="scss" scoped>
.tl-dialog {
  width: auto;
  /deep/.el-form-item__label {
    text-align: left;
    width: 80px !important ;
  }
  /deep/ .el-dialog__body {
    padding-bottom: 10px;
  }
  /deep/.el-form-item__content {
    margin-left: 80px !important;
  }
  /deep/ .el-input__inner.el-input--small {
    width: 180px;
  }
}
</style>
